/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.charproperty.支持补集;

/**
 *
 * @author yanxi
 */
public class Script extends CharProperty支持补集 { 
    public final Character.UnicodeScript script;
    public String name=null;
    public Script(String name,Character.UnicodeScript script) {
        this.script = script; 
        this.name=name;
    }
    
    @Override
    public boolean isSatisfiedBy正集 (int ch) {
        return script == Character.UnicodeScript.of(ch);
    } 
    
    @Override
    public String toString正集(){ 
        if(name.equals("Is"))return "\\p{Is"+script+"}";
        else return "\\p{"+name+"="+script+"}";
    }
    @Override
    public String toString补集(){ 
        if(name.equals("Is"))return "\\P{Is"+script+"}";
        else return "\\P{"+name+"="+script+"}";
    }
    
}
